[FIX] stock_ux: skip manual lines check on manual action_assign#947
Closed
jcadhoc wants to merge 1 commit into
Closed
[FIX] stock_ux: skip manual lines check on manual action_assign#947jcadhoc wants to merge 1 commit into
jcadhoc wants to merge 1 commit into
Conversation
Collaborator
The _check_manual_lines guard only bypassed the check when reservation came from the automatic _trigger_assign. Pressing 'Check availability' (action_assign) on a picking creates reservation move lines without the trigger_assign context, so a negative available quantity (e.g. a leftover negative quant) wrongly raised 'You can't transfer more quantity than the quantity on stock!'. Set trigger_assign in _action_assign so the manual button bypasses _check_quantity_available too.
f8b3d31 to
50fb042
Compare
Contributor
|
@roboadhoc r+ nobump |
roboadhoc
pushed a commit
that referenced
this pull request
Jun 12, 2026
The _check_manual_lines guard only bypassed the check when reservation came from the automatic _trigger_assign. Pressing 'Check availability' (action_assign) on a picking creates reservation move lines without the trigger_assign context, so a negative available quantity (e.g. a leftover negative quant) wrongly raised 'You can't transfer more quantity than the quantity on stock!'. Set trigger_assign in _action_assign so the manual button bypasses _check_quantity_available too. closes #947 Signed-off-by: Matias Velazquez <mav@adhoc.com.ar>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Pressing Check availability (
action_assign) on a picking could wrongly raise:_check_manual_lines(instock.move.line.create) runs_check_quantity_available, which is meant to block users from manually loading more quantity than available. That check is bypassed when the reservation comes from the automatic_trigger_assign(it sets thetrigger_assigncontext key).But the manual
action_assignbutton goes straight tostock.move._action_assign()without that context, so when the source location has a negative available quantity (e.g. a leftover negative quant), assigning creates reservation move lines whose_check_quantity_available()is negative and the validation fires — even thoughaction_assignis not loading manual lines, just reserving.Fix
Override
stock.move._action_assignto settrigger_assign=Truein context, mirroring_trigger_assign. Reservation (manual or automatic) now consistently bypasses_check_quantity_available, while manual edits on move lines remain blocked as before.